package com.jmhy.sdk.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.jmhy.sdk.config.AppConfig;

import java.util.List;

/**
 * Created by on 2015/12/20.
 */
public class UserAccount8Adapter extends BaseAdapter{
	private Context context;
	private List<String> list;
	private UserAccount8Adapter.InnerItemOnclickListener mListener;
	public UserAccount8Adapter(Context context, List<String> list) {
		this.context = context;
		this.list = list;
	}

	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public String getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		UserAccount8Adapter.Item item;
		if (convertView == null) {
			convertView = LayoutInflater.from(context).inflate(
					AppConfig.resourceId(context, "jm_item_account_list_8", "layout"),
					null);
			item = new UserAccount8Adapter.Item();
			item.user = (TextView) convertView.findViewById(AppConfig
					.resourceId(context, "TextView", "id"));

			convertView.setTag(item);
		} else {
			item = (UserAccount8Adapter.Item) convertView.getTag();
		}
		item.user.setText(list.get(position));

		return convertView;
	}

	private class Item {

		private TextView user;

	}

	public interface InnerItemOnclickListener {
		void itemClick(int position);
	}

	public void setOnInnerItemOnClickListener(UserAccount8Adapter.InnerItemOnclickListener listener){
		this.mListener=listener;
	}
}
